package cn.wolfcode.mapper;

import cn.wolfcode.domain.Role;
import cn.wolfcode.domain.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from  role where role_id in(select role_id from user_role where u_id = #{userId})")
    Set<Role> getUserRoles(Integer userId);
}
